package com.ftn;

import java.awt.*;

/**
 * User: Jack Fu
 * Date: 2024/9/6
 * Time: 9:56
 * To change this template use File | Settings | File Templates.
 * Description:
 */
public class ExplodeObj extends GameObj{

    static Image[] explodeImages = new Image[6];

    public int count = 0;

    static {
        for (int i = 0; i < explodeImages.length; i++) {
            explodeImages[i] = Toolkit.getDefaultToolkit().getImage("imgs/baozha" + i + ".png");
        }
    }

    public ExplodeObj() {
    }

    public ExplodeObj(int x, int y) {
        super(x, y);
    }

    public ExplodeObj(int x, int y, int width, int height, Image image, int speed, GameWin gameWin) {
        super(x, y, width, height, image, speed, gameWin);
    }

    public ExplodeObj(int x, int y, Image image, int speed) {
        super(x, y, image, speed);
    }

    @Override
    public void paintSelf(Graphics g) {
        if (count < 6) {
            this.image = explodeImages[count];
            super.paintSelf(g);
            count++;
        }
    }

    @Override
    public Rectangle getRec() {
        return super.getRec();
    }
}
